<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<title>最新文件</title>
		<!--标准mui.css-->
		<link rel="stylesheet" href="css/mui.min.css">
		<!--App自定义的css-->
		<link rel="stylesheet" type="text/css" href="css/app.css" />
		<link rel="stylesheet" type="text/css" href="css/reset.css" />
		<style>
			.note-list,
			.folder-list {
				padding: 10px 0 10px;
				border-bottom: dashed 1px #CACACD;
				flex-flow: column;
			}
			
			.title-weight {
				font-size: 16px;
				font-weight: bold;
				margin-bottom: 10px;
			}
			/*文件夹图标*/
			
			@font-face {
				font-family: 'iconfont';
				/* project id 1571015 */
				src: url('//at.alicdn.com/t/font_1571015_wp63s5c36xe.eot');
				src: url('//at.alicdn.com/t/font_1571015_wp63s5c36xe.eot?#iefix') format('embedded-opentype'), url('//at.alicdn.com/t/font_1571015_wp63s5c36xe.woff2') format('woff2'), url('//at.alicdn.com/t/font_1571015_wp63s5c36xe.woff') format('woff'), url('//at.alicdn.com/t/font_1571015_wp63s5c36xe.ttf') format('truetype'), url('//at.alicdn.com/t/font_1571015_wp63s5c36xe.svg#iconfont') format('svg');
			}
			
			.iconfont {
				font-family: "iconfont" !important;
				font-size: 16px;
				font-style: normal;
				-webkit-font-smoothing: antialiased;
				-moz-osx-font-smoothing: grayscale;
			}
			
			.title {
				margin: 5px 0px 0px 0px;
				color: #6d6d72;
				font-size: 12px;
			}
			
			.star {
				float: right;
				margin-right: 10px;
			}
		</style>
	</head>

	<body>
		<header class="mui-bar mui-bar-nav">
			<a class="mui-icon mui-icon-left-nav mui-pull-left" id="back_folder" onClick="javascript :history.back(-1);" style="color: #000;"></a>
			<h1 class="mui-title">最新文件</h1>
		</header>
		<div class="mui-input-row mui-search">
			<input type="search" class="mui-input-clear" placeholder="搜索">
		</div>
		<!--显示最新的笔记-->
		<div id="list_box">
			<ul id="list-ul" class="mui-table-view ">
			</ul>

		</div>
		<script src="js/jquery-3.4.1.js"></script>
		<script>
			mui.init();
			mui.plusReady(function() {
				var token = plus.storage.getItem('accessToken');
				$.ajax({
					type: "post",
					url: 'http://343bdb1.cpolar.io/note-notes/notes/newnote',
					data: {
						id: token,
						token: token
					},
					dataType: 'json',
					success: function(data) {
						$("#list-ul").empty();
						for(i = 0; i < data.length; i++) {
							$("#list-ul").append('<li class="mui-table-view-cell"><div class="note-list" onclick="turnPage()"><span class="title-weight">' + data[i].notesName + '</span><p class="title">' + data[i].size +
								'</p><p class="title">' + data[i].updateTime + '</p></div></li>')
						}
					},
					error:function(xhr,type,errorThrown){
						//异常处理；
						alert(type);  
					}
				});
				
			})
			
				

			// 在这里调用plus api

			/*$("#back_folder").click(function(){
				console.log("aaa")
				mui.openWindow('tabbar.html')
				$("#tabbar-with-map").load("personal.html")
			})*/

			//跳转到查看页面的方法
			function turnPage() {
				mui.openWindow({
					url: "show_note.html",
					id: "show_note",
					show: {
						aniShow: 'pop-in'
					},
					waiting: {
						autoShow: false
					},
					extras: {

						myname: "youzai"
					}
				});
			}
			/*$.ajax({
				type:"get",
				url:"",
				data:'',
				contentType:'application/json',
				dataType:'json',
				success : function(d){
					for (var i = 0; i < d.data.length; i++) {
						var data=d.data[i];
						$('#newest_note').innerHTML=$('#newest_not').innerHTML+'<div class="note-list" onclick="turnPage()">'
							+'<span class="title-weight">标题<img src="img/star.png" class="star"/></span>'
							+'<p class="title">摘要</p>'
							+'<p class="title">时间</p>'
							+'</div>'
					}													
				}
			});*/
		</script>
	</body>

</html>